﻿import game.Main
import game.DataManager
import mx.utils.Delegate;


class game.Board extends MovieClip{
	private var _cDM:DataManager
	private var _sbtPointUp:Button
	
	public function Board(){
		
	}

	public function onInitialize(){
		_cDM = DataManager.getInstance();
		_cDM.setScore(0);
		_parent.setScore(0);
		_sbtPointUp.onRelease = Delegate.create(this, scorePoints);
		_sbtPointUp.onRollOver = Delegate.create( Main.getInstance(),  Main.getInstance()._cSoundManager.rolloverSoundStart );
		Main.getInstance()._cSoundManager.musicSoundStop();
		Main.getInstance()._cSoundManager.musicSoundStart();
		
	}
	
	
	
	public function onReset(){
		onInitialize();
	}
	
	public function scorePoints(){
		Main.getInstance()._cSoundManager.pointUpSoundStart()
		_cDM.addToScore(100);
		_parent.setScore(_cDM.getScore());
	}
	

}